package com.five.common.dao;

import com.five.common.entity.LoginTable;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.five.common.entity.ModPasswordDTO;
import com.five.common.entity.StudentLoginer;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ywt
 * @since 2024-07-18
 */
@Mapper
public interface LoginTableMapper extends BaseMapper<LoginTable> {

    @Insert("insert into login_table (s_number, phone, password, name, avatar, type) VALUES " +
            "(#{sNumber},#{phone},#{password},#{name},#{avatar},#{type})")
    Integer addStudentLoginer(StudentLoginer studentLoginer);

    @Select("select * from login_table where phone=#{phone};")
    LoginTable getLoginInfo(String phone);

    @Update("update login_table set password=#{newPassword} where id=#{id}")
    int modPassword(ModPasswordDTO modPasswordDTO);
}
